package com.yeung.exam;

import java.util.Scanner;

public class 携程_IP {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String ip = sc.nextLine();
        String limit = sc.nextLine();
        if (limit.equals(ip)) {
            System.out.println(1);
        } else if (limit.contains("/")) {
            //限制是子网格式
            String[] split = limit.split("/");
            String limitIp = split[0];
            int subPort = Integer.parseInt(split[1]);


        } else {
            System.out.println(0);
        }


    }
}
